<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/2
 * Time: 13:48
 */

namespace app\admin\controller;


use think\Controller;

class Index1 extends Controller
{
   public  function  index(){
       $t = array(
           ['effect_id'=>1,'result_value'=>'1'],
           ['effect_id'=>1,'result_value'=>'1'],
           ['effect_id'=>1,'result_value'=>'1'],
           ['effect_id'=>2,'result_value'=>'1'],
           ['effect_id'=>2,'result_value'=>'1'],
           ['effect_id'=>3,'result_value'=>'1'],
           ['effect_id'=>4,'result_value'=>'1'],
           ['effect_id'=>3,'result_value'=>'1'],
       );
       $arr_new = array();
       for ($i = 0; $i < count($t); $i++){
           $effect_id = $t[$i]['effect_id'];
           $arr_new[$effect_id][]=$t[$i];
       }
       var_dump($arr_new);
    return  $this->fetch();
   }


}